﻿@{
    ViewBag.Title = "RoleDetail";
    Layout = "~/Views/Shared/_LayoutChild.cshtml";
}
@model Agro.Models.T_Role
@section head {
    @Html.Partial("_ModelValidator")
    <script language="javascript" type="text/javascript">
        var _type = '@ViewBag.type';
        $(document).ready(function () {
            if (_type != null && _type == "edit")
                $("#Role_Code").attr("disabled", "disabled");
        });
        function Save(t) {
            //角色编号与名称不能为空
            var roleCode = $("#Role_Code").val();
            if (roleCode == "") {
                alert("角色编号不能为空!");
                return;
            }
            //角色名称不能为空
            var rolename = $("#Role_Name").val();
            if (rolename == "") {
                alert("角色名称不能为空!");
                return;
            }
            $.funSaveForm("/SystemManage/Role/SaveRole", "formDetail", function (d) {
                $("#Role_ID").val(d);
                parent.asyncbox.tips('保存成功!', 'success');
                MainFrame().$(MainFrame().gridId).trigger("reloadGrid");
                parent.$.close(t.id);
            });
        }
    </script>
}
<!--主窗体，页面都需要的div-->
<div class="ui-layout-center" style="overflow: hidden;">
    @using (Html.BeginForm("", "", FormMethod.Post, new Dictionary<string, object> { { "id", "formDetail" } }))
    {
        @Html.HiddenFor(model => model.Role_ID) 
        @Html.HiddenFor(model => model.Role_CreateDate) 
        @Html.HiddenFor(model => model.Role_CreateIP)
        @Html.HiddenFor(model => model.Role_CreateUserID)
        @Html.HiddenFor(model => model.Role_IsInnerRole)
        <div class='b-col'>
            <div class="col-name">
                <font color="red">*</font> <font color="blue">角色编码</font>：</div>
            <div class="col-input">@Html.TextBoxFor(model => model.Role_Code)</div>
        </div>
        <div class='b-col'>
            <div class="col-name">
                <font color="red">*</font> <font color="blue">角色名称：</font></div>
            <div class="col-input">@Html.TextBoxFor(model => model.Role_Name)</div>
        </div>
        <div class='b-col'>
            <div class="col-name">
                角色描述：</div>
            <div class="col-input">@Html.TextBoxFor(model => model.Role_Description)</div>
        </div>
        <div class='b-col'>
            <div class="col-name">
                是否有效：</div>
            <div class="col-input">
                <label>
                    是</label>@Html.RadioButtonFor(model => model.Role_IsAvailable, "1") &nbsp;&nbsp;<label>
                        否</label>@Html.RadioButtonFor(model => model.Role_IsAvailable, "0")</div>
        </div>
        <div class='b2-col'>
            <ul>
                <li>
                    @Html.ValidationMessageFor(m => m.Role_Code)
                </li>
                <li>
                    @Html.ValidationMessageFor(m => m.Role_Name)
                </li>
            </ul>
        </div>
    }
</div>
